package com.gaofans.vertx.boot.web.annotation;

import com.gaofans.vertx.boot.web.handler.HttpHandlerPosition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

import static org.springframework.beans.factory.config.ConfigurableBeanFactory.SCOPE_SINGLETON;

/**
 * @author GaoFans
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE,ElementType.METHOD})
@Documented
@Component
@Scope
@Bean
public @interface HttpHandler {

    @AliasFor(annotation = Scope.class)
    String scopeName() default SCOPE_SINGLETON;

    int order() default 0;

    String[] path() default {"/**"};

    HttpHandlerPosition position() default HttpHandlerPosition.PRE;

}
